<?php #coding: utf-8 æ ø å ?>

<h2 class="rubrik">Rediger eksisterende titler</h3>

<?php


$person = new entitet();
$person->find_alle_titler($stamdata['id']);
$alle_titler = $person->alle_titler;

?>
<form action="<? echo base_url();?>unikt_entitet/entitet_titel/rediger_titler" method="post">
<?
echo "<p class='ink'>";
$id_array = array();

foreach($alle_titler as $a){
	$id_array[] = $a['relation_titel_id'];
	echo anchor("core/vis/se/gruppe/".$a['id_gruppe'],$a['navn_gruppe'],"class='ink'").":<br>";
	$alt_titler = $this->gruppe_styring->find_titler_indenfor_gruppe($a['id_type']);
	?>
	<select name="titel_<? echo $a['relation_titel_id']; ?>">	
		<?
		foreach($alt_titler[0] as $b){
			?>
			<option value="<? echo $b['id'] ;?>" <? if($a['id']==$b['id']){ echo "selected='selected'"; } ?>><? echo $b['navn']; ?></option>
			<?	
		}
		?>
	</select>
	<input type="text" name="sub_titel_<? echo $a['relation_titel_id']; ?>" value="<? echo $a['sub_titel']; ?>"><br>
	<?
}
$id_array = $this->array_model->post_ider_send($id_array);
?>
<input type="hidden" name="id_array" value="<? echo $id_array; ?>">
<input type="hidden" name="id_individ" value="<? echo $stamdata['id']; ?>">
<?
echo "</p>";

?>
<input type="submit" value="Rediger">
</form>
<br><br>
<h2 class="rubrik">
<?
echo anchor("core/vis/se/individ/".$stamdata['id']."/tilføj_titel","Tilføj ny titel (virker ikke endnu)","class='rubrik'")."<br>";
?>
</h3>
